<#import "/ftl/mainAdmin.ftl" as page>

<@page.mainTemplate styleSheet="commanageCss" jsFile="goodsManageJs" current="商品管理">
	<div class="page-content">
		<div class="page-head">
			<div class="page-title">
				<h1>商品管理
					<small>新增商品</small>
				</h1>
			</div>
		</div>
		<div class="row">
			<div class="portlet light borderd">
				<div class="portlet-body form edit-form">
					<form action="#" id="createForm" class="createForm createform">
                        <div class="row">
                            <div class="col-md-6 ">
                                <div class="form-group">
                                    <div class="input-group">
                                        <label class="input-group-addon">发布类型</label>
                                        <div class="input-group-content">
                                            <select class="form-control input-inline" name="data_type" style="">
                                                <option value="">--请选择发布类型--</option>
                                                <option value="DATA_COMMING_SELF_SUPPORT">自营</option>
                                                <option value="DATA_TAX_CARE_FREE">金税无忧</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-6 ">
                                <div class="form-group">
                                    <div class="input-group">
                                        <label class="input-group-addon">产品编号</label>
                                        <div class="input-group-content">
                                            <input type="text" id="sku_id" name="sku_id" class="form-control" placeholder="产品编号"   value="" style="">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-6 ">
                                <div class="form-group">
                                    <div class="input-group">
                                        <label class="input-group-addon">服务名称</label>
                                        <div class="input-group-content">
                                            <input type="text" id="name" name="name" class="form-control" placeholder="服务名称"   value="" style="">
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-6 ">
                                <div class="form-group">
                                    <div class="input-group">
                                        <label class="input-group-addon">产品价格</label>
                                        <div class="input-group-content">
                                            <input type="text" id="price" name="price" class="form-control" placeholder="产品价格" onBlur="check(this)"  value="" style="">
                                            <span class="tips txt-alert" style="display:none;color:red;">产品价格格式输入不正确</span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-6 ">
                                <div class="form-group">
                                    <div class="input-group">
                                        <label class="input-group-addon">产品数量</label>
                                        <div class="input-group-content">
                                            <input type="text" id="number" name="number" class="form-control" placeholder="产品数量"   value="" style="">
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-6 ">
                                <div class="form-group">
                                    <div class="input-group">
                                        <label class="input-group-addon">产品状态</label>
                                        <div class="input-group-content">
                                            <input type="text" id="state_str" name="state_str" class="form-control" placeholder="" readonly="readonly"  value="待发布" style="">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-6 ">
                                <div class="form-group">
                                    <div class="input-group">
                                        <label class="input-group-addon">发布对象</label>
                                        <div class="input-group-content">
                                            <select class="form-control input-inline" name="publishCompany" style="">
                                                <option value="">请选择公司</option>
                                            </select>
                                        </div>
                                    </div>
                                    <input type="hidden" id="business_ids" name="business_ids" class="form-control"   value="" >
                                    <ul class="list-group" id="companyList" style="margin-left: 111px;">
                                        <#list mComConsumerVO.company_list as list>
                                        <li class="list-group-item" data-id="${list.id}"> ${list.company_name}
                                            <span class="pull-right ">
                                            <a class="btn btn-xs btn-primary" name="manage">管理权限</a>
                                            <a class="btn btn-xs red" name="delete">删除</a>
                                        </span>
                                        </li>
                                    </#list>
                                    </ul>
                                </div>
                            </div>
                            <div class="col-md-6 ">
                                <div class="form-group">
                                    <div class="input-group">
                                        <label class="input-group-addon">收款商户</label>
                                        <div class="input-group-content" style="">
                                            <select class="form-control input-inline" name="channel_id" id="channel_id">
                                                <option value="">请选择收款商户</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-6 ">
                                <div class="form-group">
                                    <div class="input-group">
                                        <label class="input-group-addon">图片名称</label>
                                        <div class="input-group-content">
                                            <input type="text" id="local_image" name="local_image" class="form-control" placeholder="图片名称"  value="" style="">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-6 ">
                                <div class="form-group">
                                    <div class="input-group">
                                        <label class="input-group-addon" style="height:200px;line-height:178px;">详细介绍</label>
                                        <div class="input-group-content">
                                            <textarea id="introduction" class="form-control" name="introduction" placeholder="详细介绍" style="height:200px;" ></textarea>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-6 ">
                                <div class="form-group">
                                    <div class="input-group">
                                        <label class="input-group-addon" style="height:200px;line-height:178px;">商品说明</label>
                                        <div class="input-group-content">
                                            <textarea id="param" name="param" placeholder="商品说明" class="form-control" style="height:200px;" ></textarea>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                		<div class="form-actions top">
                			<div class="row">
                				<button type="submit" id="GoodsSave" class="btn green GoodsSave">保存</button>
                				<button type="submit" id="GoodsSaveRe" class="btn green GoodsSave">保存并发布</button>
                				<a href="${context}/goods/goodManageList" class="btn default">取消</a>
                			</div>
                		</div>
					</form>
				</div>
			</div>
		</div>
	</div>
	<script>
		function check(v){
		    var num = $(v).val();
			var a=/^[0-9]*(\.[0-9]{1,2})?$/;
				if(!a.test(num)){
					$(".tips").css("display","")
					$(v).val("");
					return false;
				}else{
					$(".tips").css("display","none")
				}
		}
	</script>
</@page.mainTemplate>